#include "StdAfx.h"
#include "FileTransferThread.h"


FileTransferThread::FileTransferThread(void)
{
	memset(m_cFileBuf, 0, sizeof(m_cFileBuf));
	m_nReadByte = 0;
	m_nTotalByte = 0;
}

FileTransferThread::~FileTransferThread(void)
{
}


void FileTransferThread::Close()
{
	closesocket(m_nSocket);
	fclose( m_pf );
}

void FileTransferThread::SetProgressBar(CProgressCtrl *pPCtrl, int fileSize)
{
	m_pkProgressCtrl = pPCtrl;
	m_nTotalByte = fileSize;
	m_pkProgressCtrl->SetRange32(0, m_nTotalByte);
}

void FileTransferThread::SetProgressBar(CProgressCtrl *pPCtrl)
{
	m_pkProgressCtrl = pPCtrl;
}

void FileTransferThread::SetProgressBar(int fileSize)
{
	m_nTotalByte = fileSize;
	m_pkProgressCtrl->SetRange32(0, m_nTotalByte);
}